package com.daoyin.ssph.action;

import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts2.ServletActionContext;
import org.springframework.web.portlet.bind.annotation.ResourceMapping;

import com.daoyin.ssph.bean.Message;
import com.daoyin.ssph.service.MessageService;


public class MessageAction {
	private MessageService ma;
	
	public void setMa(MessageService ma) {
		this.ma = ma;
	}
	private String id;
	
	public void setId(String id) {
		this.id = id;
	}
	

	public String show(){
		HttpServletRequest request = ServletActionContext.getRequest();
		List<Message> list = ma.query();
		
		request.setAttribute("show", list);
		return "success";
	
	}
	public String delete(){
		ma.delete(Integer.parseInt(id));
		return "success";
	}
}
